#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main()
{
	int a[3][3];
		int i, j, n = -1, maxi, minj; int k,t,t2,flag=0,t4=0;
		srand(time(0));
		for (i = 0; i < 3; i++)
			for (j = 0; j < 3; j++)
				a[i][j] = rand() % 10;

		printf("  ");
		for (i = 0; i < 3; i++)
			printf("%3d", i + 1);
		printf("\n");
		for (i = 0; i < 3; i++)
		{
			printf("%-2d", i+1);
			for (j = 0; j < 3; j++)
				printf("%3d", a[i][j]);
			printf("\n");
		}
		for (i = 0; i < 3; i++)
		{
			maxi = a[i][0];
			for (j = 1; j < 3; j++)
				maxi = maxi > a[i][j] ? maxi : a[i][j];
				for (j = 0; j < 3; j++)
					if (maxi == a[i][j])
					{
						t = j;
						break;
					}
			
			minj = a[i][t];
			for (k = 0; k < 3; k++)
				minj = minj < a[k][t] ? minj : a[k][t];
			for(k=0;k<3;k++)
				if (minj == a[k][t])
				{
					t2 = k;
					break;
				}
			if (maxi == minj)
			{
				t4= 1;
				break;
			}
		}
		if (t4)
		{
			for (i = 0; i < 3; i++)
				for (j = 0; j < 3; j++)
				{
					n = 1;
					if (a[i][j] == maxi)
					{

						for (int m = 0; m < 3; m++)
						{
							if (a[i][m] > maxi)
							{
								n = 0;
								break;
							}
							flag = 1;
						}
						if (flag == 1)
							for (int k = 0; k < 3; k++)
								if (a[k][j] < minj) { n = 0; break; }
						if (n == 0)break;
						printf("    %d  ,%d  \n", i + 1, j + 1);

					}
				}
		}
		else printf("none");
}
